namespace PHMEE.PHM.Algorithms.Diagnosis;

/// <summary>
/// 滑油-燃油分油机故障诊断算法
/// </summary>
public class OilFuelSeparatorAlg
{
    private readonly OilFuelSeparatorService.OilFuelSeparatorServiceClient _client;

    public OilFuelSeparatorAlg(OilFuelSeparatorService.OilFuelSeparatorServiceClient client)
    {
        _client = client;
    }

    /// <summary>
    /// 滑油-燃油分油机故障诊断算法
    /// </summary>
    /// <param name="pointPosition"></param>
    /// <param name="data"></param>
    /// <param name="sampleRate"></param>
    /// <param name="equipmentParameters"></param>
    /// <param name="thresholds"></param>
    /// <returns></returns>
    public async Task<OilFuelSeparatorResponse> OilFuelSeparatorAsync(PointPosition pointPosition, float[] data, float sampleRate,
        OilFuelSeparatorEquipmentParameters equipmentParameters, OilFuelSeparatorThresholds thresholds)
    {
        var request = new OilFuelSeparatorRequest
        {
            Position = pointPosition,
            Data = { data },
            SampleRate = sampleRate,
            EquipmentParameters = equipmentParameters,
            Thresholds = thresholds
        };

        var response = await _client.OilFuelSeparatorAlgAsync(request);

        return response;
    }
}